package cn.attackme.myuploader.service.impl;

import cn.attackme.myuploader.dao.UserDao;
import cn.attackme.myuploader.model.User;
import cn.attackme.myuploader.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public User getUser(String username) {
        return userDao.getUser(username);
    }

    @Override
    public int save(User user) {
        return userDao.save(user);
    }

    @Override
    public int update(User user) {
        return userDao.update(user);
    }

    @Override
    public int delete(String username) {
        return userDao.delete(username);
    }

    @Override
    public User login(String username, String password) {
        return userDao.login(username,password);
    }

    @Override
    public List<Map<String,Object>> findAll() {
        return userDao.fandAllList();
    }
}
